package kz.kstu.scantest.business.common.form.builder;

import kz.kstu.scantest.business.entity.data.FieldNameEnum;
import kz.kstu.scantest.business.entity.form.Form;
import kz.kstu.scantest.business.entity.form.Field;

/**
 * @author Filipp_Stankevich
 *         created: 08.09.11 16:07
 */
public class DefaultFormBuilder extends AbstractFormBuilder {
    @Override
    protected void build(Form form) {
        Field surnameField = new Field();
        surnameField.setFieldName(FieldNameEnum.SURNAME);
        surnameField.setStartPosition(1);
        surnameField.setLength(17);
        form.addField(surnameField);

        Field initialsField = new Field();
        initialsField.setFieldName(FieldNameEnum.INITIALS);
        initialsField.setStartPosition(18);
        initialsField.setLength(2);
        form.addField(initialsField);

        Field variantField = new Field();
        variantField.setFieldName(FieldNameEnum.VARIANT);
        variantField.setStartPosition(20);
        variantField.setLength(4);
        form.addField(variantField);

        Field classField = new Field();
        classField.setFieldName(FieldNameEnum.CLASS_LETTER);
        classField.setStartPosition(24);
        classField.setLength(1);
        form.addField(classField);

        Field firstSubjectField = new Field();
        firstSubjectField.setFieldName(FieldNameEnum.FIRST_SUBJECT);
        firstSubjectField.setStartPosition(30);
        firstSubjectField.setLength(30);
        form.addField(firstSubjectField);

        Field secondField = new Field();
        secondField.setFieldName(FieldNameEnum.SECOND_SUBJECT);
        secondField.setStartPosition(61);
        secondField.setLength(30);
        form.addField(secondField);

        Field thirdSubjectField = new Field();
        thirdSubjectField.setFieldName(FieldNameEnum.THIRD_SUBJECT);
        thirdSubjectField.setStartPosition(93);
        thirdSubjectField.setLength(30);
        form.addField(thirdSubjectField);

        Field fourthField = new Field();
        fourthField.setFieldName(FieldNameEnum.FOURTH_SUBJECT);
        fourthField.setStartPosition(125);
        fourthField.setLength(30);
        form.addField(fourthField);

        Field fifthSubjectNameField = new Field();
        fifthSubjectNameField.setFieldName(FieldNameEnum.FIFTH_SUBJECT_NAME);
        fifthSubjectNameField.setStartPosition(155);
        fifthSubjectNameField.setLength(2);
        form.addField(fifthSubjectNameField);

        Field fifthSubjectField = new Field();
        fifthSubjectField.setFieldName(FieldNameEnum.FIFTH_SUBJECT);
        fifthSubjectField.setStartPosition(157);
        fifthSubjectField.setLength(30);
        form.addField(fifthSubjectField);
    }
}
